<template>
  <div class="goodsdesc-container">
    <h3 class="title">{{ info.title }}</h3>
    <hr />
    <div class="content" v-html="info.content"></div>
  </div>
</template>

<script>
export default {
  created() {
    // 获取数据
    this.__getGoodsdesc();
  },
  props: ["id"],
  data() {
    return {
      info: {}
    };
  },
  methods: {
    // ======== 发送网络请求 =======
    async __getGoodsdesc() {
      const { data: res } = await this.$http.get("goods/getdesc/" + this.id);
      if (res.status !== 0) return;
      this.info = res.message[0];
    }
  }
};
</script>

<style lang='scss' >
.goodsdesc-container {
  .title {
    font-size: 15px;
    text-align: center;
    padding: 5px 0;
    color: blue;
  }
  .content {
    img {
      width: 100%;
    }
  }
}
</style>